Skip to content

Review fixes for the units conversion table (#1199) - #1

Merged
rundvd merged 4 commits into
rundvd:bug/units-conversion-factorsfrom
RocketPy-Team:bug/units-review-fixes
Nov 17, 2026
Merged

rundvd merged 4 commits into
rundvd:bug/units-conversion-factorsfrom
RocketPy-Team:bug/units-review-fixes

Conversation

@Gui-FernandesBR

Copy link
Copy Markdown

Follow-up to RocketPy-Team#1199, from its review. convert_units no longer edits the Function it is given, and FlightDataImporter converts through a new convert_to_base_unit instead of dividing its read data in place, so a unit outside the table (degC included) raises the module's ValueError rather than a KeyError. The table now documents how it is read and uses the exact pound and mercury constants, so the definition test runs at rel=1e-9, and the metric EnvironmentAnalysis acceleration unit is "gs", since "g" is gram. The changelog is filled in on merge from RocketPy-Team#1199's title and body, so the note that ft/s^2, atm, mg, g, deg and grad results change belongs in that description.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XDW574kgc6gnnChDhsWmRZ

Gui-FernandesBR and others added 4 commits November 15, 2026 23:28
Document how the conversion table is read (units per base unit), the
convention the inverted entries broke, and replace the rounded lb, mmHg
and inHg constants with their exact definitions so the definition test
can run at rel=1e-9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDW574kgc6gnnChDhsWmRZ
"g" is gram in the units table, so converting with the metric
unit_system["acceleration"] would apply a mass factor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDW574kgc6gnnChDhsWmRZ
convert_units_Functions scaled get_source() and renamed the axis labels
in place, so converting a Function twice applied the factor to data
already converted. Work on copies, and run every unit definition through
the Function path on both axes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDW574kgc6gnnChDhsWmRZ
The importer divided a view of _data in place by UNITS_CONVERSION_DICT,
so the stored data turned into SI while still labelled with the original
units, and a unit outside the table (degC included) raised a bare
KeyError. Convert through a new units.convert_to_base_unit, which
handles temperatures and raises the module's ValueError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDW574kgc6gnnChDhsWmRZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants